package com.dkd.quartz.task;


import com.dkd.system.domain.TCodeRule;
import com.dkd.system.mapper.TCodeRuleMapper;
import com.dkd.system.mapper.TWarrantyMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * 定时任务清理轨迹
 *
 * @author chuyongshuo
 */
@Component("codeTask")
@Slf4j
public class CodeTask {

    @Autowired
    TCodeRuleMapper tCodeRuleMapper;

    public void cleanCodeByType() {
        TCodeRule tCodeRule = tCodeRuleMapper.selectTCodeRuleOneByStatus();
        log.info("质保书编号定时任务每日清理，任务对象是{}",tCodeRule);
        tCodeRule.setCurrentValue(0);
        tCodeRuleMapper.updateTCodeRule(tCodeRule);
    }

}
